<cfif isDefined('form.email')>

<cfparam name="form.address" default="">
<cfparam name="form.address_2" default="">
<cfparam name="form.city" default="">
<cfparam name="form.zip" default="">
<cfquery name="insCustomer" datasource="#DSN1#">
	INSERT INTO customers (customer_name, customer_phone, customer_email, customer_address_1, customer_address_2, customer_city, customer_postal_code)
	VALUES (
			<cfqueryparam value="#form.name#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.phone#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.email#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.address#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.address_2#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.city#" cfsqltype="cf_sql_varchar">
		,   <cfqueryparam value="#form.zip#" cfsqltype="cf_sql_varchar">
	)
</cfquery>
<cfquery name="getID" datasource="#DSN1#">
	select customer_id from customers  order by customer_id desc limit 0,1
</cfquery>

<cfquery name="insOrder" datasource="#DSN1#">
	INSERT INTO customer_orders (customer_id, order_status_code, order_placed_datetime)
	VALUES (
			<cfqueryparam value="#getID.customer_id#" cfsqltype="cf_sql_varchar">
		,   3
		,   Now()
	)
</cfquery>

	<cfmail
		from="requests@DenverYardDog.com"
		to="#form.email#"
		bcc="brian@CFDeveloper.com"
		subject="DYD Estimate"
		server="mail.denveryarddog.com"
		>
#form.name#- Thank you for your Lawn and Pet Waste removal request.

You can start service by clicking here.
https://www.denveryarddog.com/start/EM=#form.email#

Thank You,
The DenverYardDog Team
(720) 515-0364
	</cfmail>
	<cfmail 
	from="#form.email#" 
	to="requests@DenverYardDog.com"
	bcc="brian@CFDeveloper.com"
	subject="Contact Form Web" 
	server="mail.denveryarddog.com">
	Name: #form.name#
	Phone: #form.phone#
	Email: #form.email#
	Address: #form.address#
	Address2: #form.address_2#
	City: #form.city#
	Zip: #form.zip#
	Help: #form.help#
	Special Instructions: #form.instruct#
	
	Lawn Size: #lawnsize#
	Freq of Mow: #freqmow#
	Number of Dogs: #numdogs#
	Cleaups Per Week: #cleanups#
	<cfif isDefined('form.cliprem') and #form.cliprem# IS NOT "">
	Clipping Removal: #cliprem#
	</cfif>
	<cfif isDefined('form.pre3mon') and #form.pre3mon# IS NOT "">
	Pre-Pay for 3 months: #pre3mon#
	</cfif>
	<cfif isDefined('form.preseason') and #form.preseason# IS NOT "">
	Pre-Pay for Season: #preseason#
	</cfif>
	</cfmail>
	<cfoutput>
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
	  <tr>
	    <td align="center" valign="middle">Thank you for your request #form.name#. If you would like to start service now. Please click here.
		<a href="https://www.denveryarddog.com/start/em=#form.email#">START SERVICE</a>
		<!---We will be in touch within 24 hours with your formal estimate.<br /> Thanks Again!--->
		
		</td>
	  </tr>
	</table>
	</cfoutput>
</cfif>